package org.shj.basic

object RegexDemo {
  def main(args: Array[String]): Unit = {
    val pattern = "(S|s)cala".r
    val str = "Scala is scalable. It's cool."
    
    println(pattern.findFirstIn(str))
    println(pattern.findAllIn(str).mkString(" | "))
    
    println((pattern replaceFirstIn (str, "Java")))
  }
}